package cn.zzuzhm.spring.aop;

import javax.annotation.Resource;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class TestAop {
    
	@Resource
	private static ApplicationContext applicationContext;
	
    public static void main(String[] args) {
		applicationContext = new ClassPathXmlApplicationContext("ApplicationContext.xml");
		Calculator calculator = (Calculator) applicationContext.getBean("calculator");
		int result = calculator.add(4, 5);
		System.out.println("result:"+result);
//		result = calculator.div(10, 0);
//		System.out.println("result:"+result);
	}

}
